Skip to content

fix: use rust-embed for DSL files#212

Closed
kevaundray wants to merge 1 commit intoleanEthereum:mainfrom
kevaundray:kw/rust-embed-src-code
Closed

fix: use rust-embed for DSL files#212
kevaundray wants to merge 1 commit intoleanEthereum:mainfrom
kevaundray:kw/rust-embed-src-code

Conversation

@kevaundray
Copy link
Copy Markdown
Contributor

@kevaundray kevaundray commented May 5, 2026

Problem

env! is evaluated at build time, so for example if we compile the crate into static libraries, the path to the DSL files will be hardcoded into the binary. This will be something like /user/tom/leanMultiSig/main.py. This is usually okay for local development, however when we want to package this so that we can use it in Python, the path will be fetched at runtime.

Potential solutions

There are two solutions that I know of for solving this:

  • explicitly pass the path to main.py in as a parameter when compiling main
  • ensure that even after compiling, we have a valid path to the main.py file

This PR goes with the second option, by embedding the dsl files into the binary with rust-embed and then creating a path to them at runtime when needed. This means that users of this library will not need to worry about supplying a path to the main.py file.

@kevaundray kevaundray marked this pull request as ready for review May 5, 2026 18:51
@kevaundray kevaundray force-pushed the kw/rust-embed-src-code branch from 7b5b674 to 350e5b0 Compare May 5, 2026 19:14
TomWambsgans added a commit that referenced this pull request May 6, 2026
…native to #212

Co-authored-by: Kevaundray Wedderburn <kevtheappdev@gmail.com>
@TomWambsgans
Copy link
Copy Markdown
Collaborator

TomWambsgans commented May 6, 2026

Hi ;) would the following fix your issue:

#214

?

TomWambsgans added a commit that referenced this pull request May 6, 2026
* move rec_aggregation .py files into zkdsl_implem/

* embedd zk_dsl files in `rec_aggregation` crate into the binary. Alternative to #212

Co-authored-by: Kevaundray Wedderburn <kevtheappdev@gmail.com>

---------

Co-authored-by: Tom Wambsgans <TomWambsgans@users.noreply.github.com>
Co-authored-by: Kevaundray Wedderburn <kevtheappdev@gmail.com>
@kevaundray kevaundray deleted the kw/rust-embed-src-code branch May 6, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants